package com.tangyh.basic.alipay.bean;


import com.tangyh.basic.base.constant.StringPool;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Collections;
import java.util.Map;

/**
 * 认证公共信息，数据来源为参数表
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class IdentifyCommonParam {

    private static final String APPCODE = "APPCODE ";

    /**
     * 请求地址
     */
    private String host;

    /**
     * 应用code
     */
    private String appcode;

    /**
     * Authorization请求头信息
     * 格式：Authorization:APPCODE 83359fd73fe94948385f570e3c139xxx
     *
     * @return 返回 Authorization请求头信息
     */
    public Map<String, String> getAuthorizationHeader() {
        return Collections.singletonMap(StringPool.HEADER_AUTHORIZATION, APPCODE.concat(appcode));
    }
}
